<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>后台管理中心</title>
        <?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>
    </head>
    <body>
        <?php echo $this->fetch('message.html'); ?>
        <div class="pad-10">
             <?php if (count ( $this->_var['sub_setting'] ) > 0): ?>
            <div class="common-form">
                <form name="myform" action="<?php echo $this->_var['action']; ?>" method="post" id="myform">
                    <fieldset>
                        <legend><?php echo $this->_var['setting_group_name']; ?><font color="red">(非技术人员不要轻易删除)</font></legend>
                        <table width="100%" class="table_form">
                            <?php $_from = $this->_var['sub_setting']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'data');if (count($_from)):
    foreach ($_from AS $this->_var['data']):
?>
                            <tr>
                                <td style="width: 20%"><?php echo $this->_var['data']['name']; ?>(<?php echo $this->_var['data']['code']; ?>)</td> 
                                <td>
                                    <textarea  style="width:50%;height:46px;"  name="<?php echo $this->_var['data']['code']; ?>"><?php echo $this->_var['data']['value']; ?></textarea>
                                </td>
                                <td>
                                    <input type="hidden" id="name_<?php echo $this->_var['data']['id']; ?>" value="<?php echo $this->_var['data']['name']; ?>">
                                    <input type="button" id="<?php echo $this->_var['data']['id']; ?>" class="button delete_setting" value="删除" />
                            </tr>
                            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                            <tr align="center">
                                <td colspan="3">
                                    <input type="submit" value="提交" name="dosubmit" class="button">
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>   <?php endif; ?>
        </div>
        <script>
            $(function(){
                $('.delete_setting').click(function(){
                    var current_id = $(this).attr('id');
                    var current_name = $('#name_'+current_id).val();
                    $.dialog.confirm('你确定要删除<font color=red>'+current_name+'</font>吗？<br/>不能恢复哦,请谨慎删除!', function(){
                        location.href="<?php echo $this->_var['site_url']; ?>admin/setting/delete/"+current_id;
                    }, function(){
                    });
                   
                });
            });
        </script>
    </body>
</html>